﻿
namespace Cubicle.Core.Processors
{
    public abstract class InstructionRequestProcessor : ConditionalProcessor<InstructionRequest>
    {
        public RequestType Processable { get; set; }

        public InstructionRequestProcessor(RequestType processable)
        {
            Processable = processable;
        }

        #region Overrides of ConditionalProcessor<InstructionRequest>

        public override bool Condition(InstructionRequest request)
        {
            var type = request.Type();
            return (type & Processable) == type;
        }

        #endregion
    }
}